/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.lang.reflect.Method;
/*     */ import java.util.ArrayList;
/*     */ import java.util.Arrays;
/*     */ import java.util.List;
/*     */ import java.util.function.Function;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.item.ItemStack;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class eos/moe/dragoncore/cw
/*     */   implements Function<uv, Object>
/*     */ {
/*     */   public Method w;
/*     */   public Class<?>[] q;
/*     */   public Object g;
/*     */   
/*     */   public eos/moe/dragoncore/cw(Method method, Object object) {
/*  42 */     this.w = method;
/*  43 */     this.w.setAccessible(true);
/*  44 */     this.g = object;
/*  45 */     this.q = method.getParameterTypes();
/*     */   }
/*     */ 
/*     */   
/*     */   public Object v(uv uv1) {
/*     */     try {
/*  51 */       Object[] arrayOfObject = new Object[this.q.length];
/*  52 */       int i = 0;
/*  53 */       for (int j = 0; j < this.q.length; j++) {
/*  54 */         Class<?> clazz = this.q[j];
/*  55 */         if (clazz == uv.class) {
/*  56 */           arrayOfObject[j] = uv1;
/*  57 */         } else if (this.g != null && clazz == this.g.getClass()) {
/*  58 */           arrayOfObject[j] = this.g;
/*     */         } else {
/*  60 */           if (clazz == int.class) {
/*  61 */             arrayOfObject[j] = Integer.valueOf(uv1.v(i, 0));
/*  62 */           } else if (clazz == String.class) {
/*  63 */             arrayOfObject[j] = uv1.v(i, "");
/*  64 */           } else if (clazz == String[].class) {
/*  65 */             List<String> list = new ArrayList();
/*  66 */             for (int k = i; k < uv1.v(); k++) {
/*  67 */               list.add(uv1.v(k));
/*     */             }
/*  69 */             arrayOfObject[j] = list.toArray(new String[0]);
/*  70 */           } else if (clazz == double.class) {
/*  71 */             arrayOfObject[j] = Double.valueOf(uv1.v(i, 0.0D));
/*  72 */           } else if (clazz == float.class) {
/*  73 */             arrayOfObject[j] = Float.valueOf((float)uv1.v(i, 0.0D));
/*  74 */           } else if (clazz == o.class) {
/*  75 */             arrayOfObject[j] = uv1.v(i);
/*  76 */           } else if (clazz == o[].class) {
/*  77 */             List<o> list = new ArrayList();
/*  78 */             for (int k = i; k < uv1.v(); k++) {
/*  79 */               list.add(uv1.v(k));
/*     */             }
/*  81 */             arrayOfObject[j] = list.toArray(new o[0]);
/*  82 */           } else if (clazz == ItemStack.class) {
/*  83 */             arrayOfObject[j] = uv1.v(i, ItemStack.field_190927_a);
/*  84 */           } else if (clazz == boolean.class) {
/*  85 */             arrayOfObject[j] = Boolean.valueOf((uv1.v(i) != 0.0D));
/*     */           } else {
/*  87 */             throw new RuntimeException("未知的参数类型: " + clazz);
/*     */           } 
/*  89 */           i++;
/*     */         } 
/*     */       } 
/*  92 */       Object object = this.w.invoke(null, arrayOfObject);
/*  93 */       if (this.w.getReturnType() != void.class) {
/*  94 */         if (this.w.getReturnType() == String.class)
/*  95 */           return new ah((String)object); 
/*  96 */         if (this.w.getReturnType() == ItemStack.class)
/*  97 */           return new kd((ItemStack)object); 
/*  98 */         if (this.w.getReturnType() == double.class || this.w
/*  99 */           .getReturnType() == int.class || this.w
/* 100 */           .getReturnType() == float.class || this.w
/* 101 */           .getReturnType() == boolean.class)
/* 102 */           return new xk(object); 
/* 103 */         if (!o.class.isAssignableFrom(this.w.getReturnType())) {
/* 104 */           throw new RuntimeException("未知的返回类型: " + this.w.getReturnType());
/*     */         }
/* 106 */         return object;
/*     */       } 
/* 108 */     } catch (Throwable throwable) {
/* 109 */       if ((Minecraft.func_71410_x()).field_71439_g != null) {
/* 110 */         ep.eos/moe/dragoncore/t eos/moe/dragoncore/t = this.w.<ep.eos/moe/dragoncore/t>getAnnotation(ep.eos/moe/dragoncore/t.class);
/* 111 */         System.out.println("方法执行出现错误: " + Arrays.toString((Object[])eos/moe/dragoncore/t.v()));
/* 112 */         throwable.printStackTrace();
/*     */       } 
/*     */     } 
/* 115 */     return xk.w;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\cw.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */